package com.derbysoft.synxisadapter.action.monitor.transactionlog;

import com.derbysoft.synxisadapter.action.BaseAdapterAction;
import com.derbysoft.synxisadapter.commons.model.TransactionLog;
import com.derbysoft.synxisadapter.commons.repository.TransactionLogRepository;
import com.opensymphony.xwork2.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;

@Results(value = {
    @Result(name = Action.SUCCESS, location = "/page/monitor/transactionlog/View.ftl")
})
public class ViewAction extends BaseAdapterAction {
    @Autowired
    private TransactionLogRepository transactionLogRepository;

    private TransactionLog transactionLog;
    private Long id;

    public String execute() throws Exception {
        transactionLog = transactionLogRepository.findById(id);
        return SUCCESS;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public TransactionLog getTransactionLog() {
        return transactionLog;
    }
}

